package com.cuijq.ms.snapdesign.v1;

import java.util.Stack;

/**
 * @author by CuiJQ
 * @Classname SnapshotHolder
 * @Description SnapshotHolder Description
 * @Date 2021/5/31 11:42
 */
public class SnapshotHolder {

  private Stack<InputText> snapshots = new Stack<>();

  public InputText popSnapshot() {
    return snapshots.pop();
  }

  public void pushSnapshot(InputText inputText) {
    InputText deepClonedInputText = new InputText();
    deepClonedInputText.setText(inputText.getText());
    snapshots.push(deepClonedInputText);
  }
}
